describe ('NoteCtrl', function ( ) {

beforeEach (module ('encsrv'));

vat notesObj = jasmine.createSpyObj ('Notes spy', ['save']);

var scope={};
var note={title:'hola', body:'hola', tags:'saludo, bonjour, guten tag'};

beforeEach (inject(function ($controller) {
$controller('NoteCtrl', {$scope: scope, Notes: notesObj});
}) );

it ('should attach a user-defined function to the scope', function ( ) {
expect(scope.insertAndSave).toBeDefined();
});

describe ('Notes', function (){
scope.insertAndSave (note);
it ('should save the note model from the scope', function () {
expect (notesObj.save).toHaveBeenCalledWith (note);
}); // spec
}); // describe Notes
}); // describe NoteCtrl